<html>
<head><meta charset="utf-8"><title>workspaces changes broke lintcheck · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html">workspaces changes broke lintcheck</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="226824294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226824294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226824294">(Feb 18 2021 at 15:10)</a>:</h4>
<p>about <a href="https://github.com/rust-lang/rust-clippy/pull/6750#issuecomment-781297551">https://github.com/rust-lang/rust-clippy/pull/6750#issuecomment-781297551</a> :<br>
Do we need the workspace entry in the manifest at all during lintcheck?<br>
I It might be the easiest workaround to just remove the 2 lines or the commit that introduced it if lintcheck runs in ci?</p>



<a name="226824445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226824445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226824445">(Feb 18 2021 at 15:11)</a>:</h4>
<p>or perhaps we can copy the file into the <code>target</code> dir and modify it there (to avoid modifying the repo) and then set a path to the temporary manifest via <code>--manifest-path</code></p>



<a name="226873511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226873511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226873511">(Feb 18 2021 at 20:18)</a>:</h4>
<p>Sorry bout that! The purpose of adding <code>[workspace]</code> was to fix the dogfood test. Do you run lintcheck with <code>cargo run</code>?</p>



<a name="226873667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226873667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226873667">(Feb 18 2021 at 20:19)</a>:</h4>
<p>yes it is included in <code>clippy_dev</code> and therefore is run with <code>cargo run</code></p>



<a name="226873789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226873789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226873789">(Feb 18 2021 at 20:20)</a>:</h4>
<p>You could try setting default-members <a href="https://doc.rust-lang.org/cargo/reference/workspaces.html#package-selection">https://doc.rust-lang.org/cargo/reference/workspaces.html#package-selection</a></p>



<a name="226873929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226873929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226873929">(Feb 18 2021 at 20:21)</a>:</h4>
<p>The problem is, that this list has to be extendable with potentially hundreds of crates.</p>



<a name="226873967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226873967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226873967">(Feb 18 2021 at 20:21)</a>:</h4>
<p>no it would just be <code>default-members = ["clippy_lints"]</code></p>



<a name="226874098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226874098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226874098">(Feb 18 2021 at 20:22)</a>:</h4>
<p>but also the docs say that <code>exclude</code> supports path glob patterns, so maybe <code>exclude = ["target/**"]</code></p>



<a name="226874373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226874373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226874373">(Feb 18 2021 at 20:24)</a>:</h4>
<p><span class="user-mention silent" data-user-id="360405">Cameron Steffen</span> <a href="#narrow/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck/near/226874098">said</a>:</p>
<blockquote>
<p>but also the docs say that <code>exclude</code> supports path glob patterns, so maybe <code>exclude = ["target/**"]</code></p>
</blockquote>
<p>Oh, I interpreted <span class="user-mention" data-user-id="217864">@matthiaskrgr</span> comment on the PR that it has to be a specific crate. In that case we should just specify  <code>exclude = ["target/**"]</code></p>



<a name="226874910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226874910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226874910">(Feb 18 2021 at 20:28)</a>:</h4>
<p>It's either-or. So probably needs a glob to be interpreted as a path.</p>



<a name="226875939"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226875939" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226875939">(Feb 18 2021 at 20:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="264664">flip1995</span> <a href="#narrow/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck/near/226874373">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="360405">Cameron Steffen</span> <a href="#narrow/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck/near/226874098">said</a>:</p>
<blockquote>
<p>but also the docs say that <code>exclude</code> supports path glob patterns, so maybe <code>exclude = ["target/**"]</code></p>
</blockquote>
<p>Oh, I interpreted <span class="user-mention silent" data-user-id="217864">matthiaskrgr</span> comment on the PR that it has to be a specific crate. In that case we should just specify  <code>exclude = ["target/**"]</code></p>
</blockquote>
<p>oh,  does that work?! I tired something similar and I could not get it to work</p>



<a name="226876010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226876010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226876010">(Feb 18 2021 at 20:35)</a>:</h4>
<p>I didn't have the <code>/**</code> though, only the path to the target dir</p>



<a name="226876453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226876453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226876453">(Feb 18 2021 at 20:38)</a>:</h4>
<p>Oh I don't think that it works. </p>
<blockquote>
<p>The <strong>members</strong> list also supports globs to match multiple paths, using typical filename glob patterns like * and ?.</p>
</blockquote>
<p>So I guess, this doesn't apply to the <code>exclude</code> list?</p>



<a name="226876473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226876473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226876473">(Feb 18 2021 at 20:38)</a>:</h4>
<p>I also just tried it and couldn't get it to work.</p>



<a name="226876802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226876802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226876802">(Feb 18 2021 at 20:41)</a>:</h4>
<blockquote>
<p>The exclude key can be used to prevent paths from being included in a workspace. This can be useful if some path dependencies aren't desired to be in the workspace at all, or using a glob pattern and you want to remove a directory.</p>
</blockquote>



<a name="226877151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226877151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226877151">(Feb 18 2021 at 20:43)</a>:</h4>
<p>Yeah, so that basically means, that it should be used if you want to use a glob pattern in <code>members</code> and then exclude one specific crate that would be picked up by the glob pattern.</p>



<a name="226877193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226877193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226877193">(Feb 18 2021 at 20:43)</a>:</h4>
<p>I asked the experts: <a href="#narrow/stream/246057-t-cargo/topic/glob.20pattern.20in.20workspace.2Eexclude/near/226876929">https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/glob.20pattern.20in.20workspace.2Eexclude/near/226876929</a></p>



<a name="226877367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226877367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226877367">(Feb 18 2021 at 20:44)</a>:</h4>
<p>Oh I see</p>



<a name="226877414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226877414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226877414">(Feb 18 2021 at 20:45)</a>:</h4>
<p>It seems like <code>target</code> should be excluded by default</p>



<a name="226877426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226877426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226877426">(Feb 18 2021 at 20:45)</a>:</h4>
<p><code>default-members</code> then?</p>



<a name="226877858"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226877858" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226877858">(Feb 18 2021 at 20:48)</a>:</h4>
<p>I don't understand why target is being included though because it is not a path dependency</p>



<a name="226878242"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226878242" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226878242">(Feb 18 2021 at 20:51)</a>:</h4>
<p>Ah so here's another tidbit</p>
<blockquote>
<p>The workspace field can be used to configure the workspace that this package will be a member of. If not specified this will be inferred as the first Cargo.toml with [workspace] upwards in the filesystem.</p>
</blockquote>



<a name="226878277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226878277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226878277">(Feb 18 2021 at 20:51)</a>:</h4>
<p>could it be for <a href="http://build.rs">build.rs</a> stuff? <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="226878571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226878571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cameron Steffen <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226878571">(Feb 18 2021 at 20:53)</a>:</h4>
<p>What if you put a Cargo.toml with <code>[workspace]</code> at <code>target/lintcheck</code> or <code>target/lintcheck/crates</code>?</p>



<a name="226882754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226882754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226882754">(Feb 18 2021 at 21:20)</a>:</h4>
<p>hm, does not seem to help :/</p>



<a name="226882893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226882893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226882893">(Feb 18 2021 at 21:21)</a>:</h4>
<p>So the glob patterns for exclude are just not implemented yet in cargo. (And it isn't clear yet if glob patterns or gitignore patterns should be used for this)</p>



<a name="226890417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/workspaces%20changes%20broke%20lintcheck/near/226890417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/workspaces.20changes.20broke.20lintcheck.html#226890417">(Feb 18 2021 at 22:09)</a>:</h4>
<p><span class="user-mention" data-user-id="360405">@Cameron Steffen</span> <span class="user-mention" data-user-id="217864">@matthiaskrgr</span> <a href="https://github.com/rust-lang/rust-clippy/issues/6763">clippy#6763</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>